<?php
namespace ImiApp\Module\Member\Service\Base;

use Imi\Model\Model;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Table;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\Entity;

/**
 * 会员表 基类
 * @Entity
 * @Table(name="sc_user", id={"id"})
 * @DDL("CREATE TABLE `sc_user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `group_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '组别ID',
  `username` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '用户名',
  `nickname` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '昵称',
  `password` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '密码',
  `salt` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '密码盐',
  `email` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '电子邮箱',
  `mobile` varchar(11) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '手机号',
  `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '头像',
  `level` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '等级',
  `gender` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '性别',
  `birthday` date DEFAULT NULL COMMENT '生日',
  `bio` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '格言',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '余额',
  `score` int(10) NOT NULL DEFAULT '0' COMMENT '积分',
  `successions` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '连续登录天数',
  `maxsuccessions` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '最大连续登录天数',
  `prevtime` int(10) DEFAULT NULL COMMENT '上次登录时间',
  `logintime` int(10) DEFAULT NULL COMMENT '登录时间',
  `loginip` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '登录IP',
  `loginfailure` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '失败次数',
  `joinip` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '加入IP',
  `jointime` int(10) DEFAULT NULL COMMENT '加入时间',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  `token` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT 'Token',
  `status` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '状态',
  `verification` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '验证',
  `admin_id` int(10) DEFAULT NULL COMMENT '机构id',
  `lng` double(12,8) DEFAULT NULL COMMENT '经度',
  `lat` double(12,8) DEFAULT NULL COMMENT '纬度',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `username` (`username`) USING BTREE,
  KEY `email` (`email`) USING BTREE,
  KEY `mobile` (`mobile`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT COMMENT='会员表'")
 * @property int $id ID
 * @property int $groupId 组别ID
 * @property string $username 用户名
 * @property string $nickname 昵称
 * @property string $password 密码
 * @property string $salt 密码盐
 * @property string $email 电子邮箱
 * @property string $mobile 手机号
 * @property string $avatar 头像
 * @property int $level 等级
 * @property int $gender 性别
 * @property string $birthday 生日
 * @property string $bio 格言
 * @property float $money 余额
 * @property int $score 积分
 * @property int $successions 连续登录天数
 * @property int $maxsuccessions 最大连续登录天数
 * @property int $prevtime 上次登录时间
 * @property int $logintime 登录时间
 * @property string $loginip 登录IP
 * @property int $loginfailure 失败次数
 * @property string $joinip 加入IP
 * @property int $jointime 加入时间
 * @property int $createtime 创建时间
 * @property int $updatetime 更新时间
 * @property string $token Token
 * @property string $status 状态
 * @property string $verification 验证
 * @property int $adminId 机构id
 * @property float $lng 经度
 * @property float $lat 纬度
 */
abstract class ScUserBase extends Model
{
    /**
     * ID
     * id
     * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true)
     * @var int
     */
    protected $id;

    /**
     * 获取 id - ID
     *
     * @return int
     */ 
    public function getId()
    {
        return $this->id;
    }

    /**
     * 赋值 id - ID
     * @param int $id id
     * @return static
     */ 
    public function setId($id)
    {
        $this->id = $id;
        return $this;
    }

    /**
     * 组别ID
     * group_id
     * @Column(name="group_id", type="int", length=10, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $groupId;

    /**
     * 获取 groupId - 组别ID
     *
     * @return int
     */ 
    public function getGroupId()
    {
        return $this->groupId;
    }

    /**
     * 赋值 groupId - 组别ID
     * @param int $groupId group_id
     * @return static
     */ 
    public function setGroupId($groupId)
    {
        $this->groupId = $groupId;
        return $this;
    }

    /**
     * 用户名
     * username
     * @Column(name="username", type="varchar", length=32, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $username;

    /**
     * 获取 username - 用户名
     *
     * @return string
     */ 
    public function getUsername()
    {
        return $this->username;
    }

    /**
     * 赋值 username - 用户名
     * @param string $username username
     * @return static
     */ 
    public function setUsername($username)
    {
        $this->username = $username;
        return $this;
    }

    /**
     * 昵称
     * nickname
     * @Column(name="nickname", type="varchar", length=50, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $nickname;

    /**
     * 获取 nickname - 昵称
     *
     * @return string
     */ 
    public function getNickname()
    {
        return $this->nickname;
    }

    /**
     * 赋值 nickname - 昵称
     * @param string $nickname nickname
     * @return static
     */ 
    public function setNickname($nickname)
    {
        $this->nickname = $nickname;
        return $this;
    }

    /**
     * 密码
     * password
     * @Column(name="password", type="varchar", length=32, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $password;

    /**
     * 获取 password - 密码
     *
     * @return string
     */ 
    public function getPassword()
    {
        return $this->password;
    }

    /**
     * 赋值 password - 密码
     * @param string $password password
     * @return static
     */ 
    public function setPassword($password)
    {
        $this->password = $password;
        return $this;
    }

    /**
     * 密码盐
     * salt
     * @Column(name="salt", type="varchar", length=30, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $salt;

    /**
     * 获取 salt - 密码盐
     *
     * @return string
     */ 
    public function getSalt()
    {
        return $this->salt;
    }

    /**
     * 赋值 salt - 密码盐
     * @param string $salt salt
     * @return static
     */ 
    public function setSalt($salt)
    {
        $this->salt = $salt;
        return $this;
    }

    /**
     * 电子邮箱
     * email
     * @Column(name="email", type="varchar", length=100, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $email;

    /**
     * 获取 email - 电子邮箱
     *
     * @return string
     */ 
    public function getEmail()
    {
        return $this->email;
    }

    /**
     * 赋值 email - 电子邮箱
     * @param string $email email
     * @return static
     */ 
    public function setEmail($email)
    {
        $this->email = $email;
        return $this;
    }

    /**
     * 手机号
     * mobile
     * @Column(name="mobile", type="varchar", length=11, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $mobile;

    /**
     * 获取 mobile - 手机号
     *
     * @return string
     */ 
    public function getMobile()
    {
        return $this->mobile;
    }

    /**
     * 赋值 mobile - 手机号
     * @param string $mobile mobile
     * @return static
     */ 
    public function setMobile($mobile)
    {
        $this->mobile = $mobile;
        return $this;
    }

    /**
     * 头像
     * avatar
     * @Column(name="avatar", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $avatar;

    /**
     * 获取 avatar - 头像
     *
     * @return string
     */ 
    public function getAvatar()
    {
        return $this->avatar;
    }

    /**
     * 赋值 avatar - 头像
     * @param string $avatar avatar
     * @return static
     */ 
    public function setAvatar($avatar)
    {
        $this->avatar = $avatar;
        return $this;
    }

    /**
     * 等级
     * level
     * @Column(name="level", type="tinyint", length=1, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $level;

    /**
     * 获取 level - 等级
     *
     * @return int
     */ 
    public function getLevel()
    {
        return $this->level;
    }

    /**
     * 赋值 level - 等级
     * @param int $level level
     * @return static
     */ 
    public function setLevel($level)
    {
        $this->level = $level;
        return $this;
    }

    /**
     * 性别
     * gender
     * @Column(name="gender", type="tinyint", length=1, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $gender;

    /**
     * 获取 gender - 性别
     *
     * @return int
     */ 
    public function getGender()
    {
        return $this->gender;
    }

    /**
     * 赋值 gender - 性别
     * @param int $gender gender
     * @return static
     */ 
    public function setGender($gender)
    {
        $this->gender = $gender;
        return $this;
    }

    /**
     * 生日
     * birthday
     * @Column(name="birthday", type="date", length=0, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $birthday;

    /**
     * 获取 birthday - 生日
     *
     * @return string
     */ 
    public function getBirthday()
    {
        return $this->birthday;
    }

    /**
     * 赋值 birthday - 生日
     * @param string $birthday birthday
     * @return static
     */ 
    public function setBirthday($birthday)
    {
        $this->birthday = $birthday;
        return $this;
    }

    /**
     * 格言
     * bio
     * @Column(name="bio", type="varchar", length=100, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $bio;

    /**
     * 获取 bio - 格言
     *
     * @return string
     */ 
    public function getBio()
    {
        return $this->bio;
    }

    /**
     * 赋值 bio - 格言
     * @param string $bio bio
     * @return static
     */ 
    public function setBio($bio)
    {
        $this->bio = $bio;
        return $this;
    }

    /**
     * 余额
     * money
     * @Column(name="money", type="decimal", length=10, accuracy=2, nullable=false, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var float
     */
    protected $money;

    /**
     * 获取 money - 余额
     *
     * @return float
     */ 
    public function getMoney()
    {
        return $this->money;
    }

    /**
     * 赋值 money - 余额
     * @param float $money money
     * @return static
     */ 
    public function setMoney($money)
    {
        $this->money = $money;
        return $this;
    }

    /**
     * 积分
     * score
     * @Column(name="score", type="int", length=10, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $score;

    /**
     * 获取 score - 积分
     *
     * @return int
     */ 
    public function getScore()
    {
        return $this->score;
    }

    /**
     * 赋值 score - 积分
     * @param int $score score
     * @return static
     */ 
    public function setScore($score)
    {
        $this->score = $score;
        return $this;
    }

    /**
     * 连续登录天数
     * successions
     * @Column(name="successions", type="int", length=10, accuracy=0, nullable=false, default="1", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $successions;

    /**
     * 获取 successions - 连续登录天数
     *
     * @return int
     */ 
    public function getSuccessions()
    {
        return $this->successions;
    }

    /**
     * 赋值 successions - 连续登录天数
     * @param int $successions successions
     * @return static
     */ 
    public function setSuccessions($successions)
    {
        $this->successions = $successions;
        return $this;
    }

    /**
     * 最大连续登录天数
     * maxsuccessions
     * @Column(name="maxsuccessions", type="int", length=10, accuracy=0, nullable=false, default="1", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $maxsuccessions;

    /**
     * 获取 maxsuccessions - 最大连续登录天数
     *
     * @return int
     */ 
    public function getMaxsuccessions()
    {
        return $this->maxsuccessions;
    }

    /**
     * 赋值 maxsuccessions - 最大连续登录天数
     * @param int $maxsuccessions maxsuccessions
     * @return static
     */ 
    public function setMaxsuccessions($maxsuccessions)
    {
        $this->maxsuccessions = $maxsuccessions;
        return $this;
    }

    /**
     * 上次登录时间
     * prevtime
     * @Column(name="prevtime", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $prevtime;

    /**
     * 获取 prevtime - 上次登录时间
     *
     * @return int
     */ 
    public function getPrevtime()
    {
        return $this->prevtime;
    }

    /**
     * 赋值 prevtime - 上次登录时间
     * @param int $prevtime prevtime
     * @return static
     */ 
    public function setPrevtime($prevtime)
    {
        $this->prevtime = $prevtime;
        return $this;
    }

    /**
     * 登录时间
     * logintime
     * @Column(name="logintime", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $logintime;

    /**
     * 获取 logintime - 登录时间
     *
     * @return int
     */ 
    public function getLogintime()
    {
        return $this->logintime;
    }

    /**
     * 赋值 logintime - 登录时间
     * @param int $logintime logintime
     * @return static
     */ 
    public function setLogintime($logintime)
    {
        $this->logintime = $logintime;
        return $this;
    }

    /**
     * 登录IP
     * loginip
     * @Column(name="loginip", type="varchar", length=50, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $loginip;

    /**
     * 获取 loginip - 登录IP
     *
     * @return string
     */ 
    public function getLoginip()
    {
        return $this->loginip;
    }

    /**
     * 赋值 loginip - 登录IP
     * @param string $loginip loginip
     * @return static
     */ 
    public function setLoginip($loginip)
    {
        $this->loginip = $loginip;
        return $this;
    }

    /**
     * 失败次数
     * loginfailure
     * @Column(name="loginfailure", type="tinyint", length=1, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $loginfailure;

    /**
     * 获取 loginfailure - 失败次数
     *
     * @return int
     */ 
    public function getLoginfailure()
    {
        return $this->loginfailure;
    }

    /**
     * 赋值 loginfailure - 失败次数
     * @param int $loginfailure loginfailure
     * @return static
     */ 
    public function setLoginfailure($loginfailure)
    {
        $this->loginfailure = $loginfailure;
        return $this;
    }

    /**
     * 加入IP
     * joinip
     * @Column(name="joinip", type="varchar", length=50, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $joinip;

    /**
     * 获取 joinip - 加入IP
     *
     * @return string
     */ 
    public function getJoinip()
    {
        return $this->joinip;
    }

    /**
     * 赋值 joinip - 加入IP
     * @param string $joinip joinip
     * @return static
     */ 
    public function setJoinip($joinip)
    {
        $this->joinip = $joinip;
        return $this;
    }

    /**
     * 加入时间
     * jointime
     * @Column(name="jointime", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $jointime;

    /**
     * 获取 jointime - 加入时间
     *
     * @return int
     */ 
    public function getJointime()
    {
        return $this->jointime;
    }

    /**
     * 赋值 jointime - 加入时间
     * @param int $jointime jointime
     * @return static
     */ 
    public function setJointime($jointime)
    {
        $this->jointime = $jointime;
        return $this;
    }

    /**
     * 创建时间
     * createtime
     * @Column(name="createtime", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $createtime;

    /**
     * 获取 createtime - 创建时间
     *
     * @return int
     */ 
    public function getCreatetime()
    {
        return $this->createtime;
    }

    /**
     * 赋值 createtime - 创建时间
     * @param int $createtime createtime
     * @return static
     */ 
    public function setCreatetime($createtime)
    {
        $this->createtime = $createtime;
        return $this;
    }

    /**
     * 更新时间
     * updatetime
     * @Column(name="updatetime", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $updatetime;

    /**
     * 获取 updatetime - 更新时间
     *
     * @return int
     */ 
    public function getUpdatetime()
    {
        return $this->updatetime;
    }

    /**
     * 赋值 updatetime - 更新时间
     * @param int $updatetime updatetime
     * @return static
     */ 
    public function setUpdatetime($updatetime)
    {
        $this->updatetime = $updatetime;
        return $this;
    }

    /**
     * Token
     * token
     * @Column(name="token", type="varchar", length=50, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $token;

    /**
     * 获取 token - Token
     *
     * @return string
     */ 
    public function getToken()
    {
        return $this->token;
    }

    /**
     * 赋值 token - Token
     * @param string $token token
     * @return static
     */ 
    public function setToken($token)
    {
        $this->token = $token;
        return $this;
    }

    /**
     * 状态
     * status
     * @Column(name="status", type="varchar", length=30, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $status;

    /**
     * 获取 status - 状态
     *
     * @return string
     */ 
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * 赋值 status - 状态
     * @param string $status status
     * @return static
     */ 
    public function setStatus($status)
    {
        $this->status = $status;
        return $this;
    }

    /**
     * 验证
     * verification
     * @Column(name="verification", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $verification;

    /**
     * 获取 verification - 验证
     *
     * @return string
     */ 
    public function getVerification()
    {
        return $this->verification;
    }

    /**
     * 赋值 verification - 验证
     * @param string $verification verification
     * @return static
     */ 
    public function setVerification($verification)
    {
        $this->verification = $verification;
        return $this;
    }

    /**
     * 机构id
     * admin_id
     * @Column(name="admin_id", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $adminId;

    /**
     * 获取 adminId - 机构id
     *
     * @return int
     */ 
    public function getAdminId()
    {
        return $this->adminId;
    }

    /**
     * 赋值 adminId - 机构id
     * @param int $adminId admin_id
     * @return static
     */ 
    public function setAdminId($adminId)
    {
        $this->adminId = $adminId;
        return $this;
    }

    /**
     * 经度
     * lng
     * @Column(name="lng", type="double", length=12, accuracy=8, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var float
     */
    protected $lng;

    /**
     * 获取 lng - 经度
     *
     * @return float
     */ 
    public function getLng()
    {
        return $this->lng;
    }

    /**
     * 赋值 lng - 经度
     * @param float $lng lng
     * @return static
     */ 
    public function setLng($lng)
    {
        $this->lng = $lng;
        return $this;
    }

    /**
     * 纬度
     * lat
     * @Column(name="lat", type="double", length=12, accuracy=8, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var float
     */
    protected $lat;

    /**
     * 获取 lat - 纬度
     *
     * @return float
     */ 
    public function getLat()
    {
        return $this->lat;
    }

    /**
     * 赋值 lat - 纬度
     * @param float $lat lat
     * @return static
     */ 
    public function setLat($lat)
    {
        $this->lat = $lat;
        return $this;
    }

}
